<?php
/**
 * Description of Home
 *
 * @author damianociarla
 */
class HomeController extends BXD_Abstract_Controller
{
	public function index()
	{
		Bxd::getInstance()->lib('validator')->loadClass("Validator");
		$validator = new LibValidator();

		$validator->addField("date")
			->addRule(LibValidator::CHECK_DATE, "dd/mm/yyyy");

		$validator->addField("age")
			->addRule(LibValidator::CHECK_INTEGER)
			->addRule(LibValidator::CHECK_MIN_VALUE, 22);

		$validator->validate(array(
			"date" => "27/08/1986",
			"age" => "21a"
		));

		var_dump($validator->getErrors());

		
	}
}
?>
